package com.xxgc.wujiaoservice.service.impl;


import com.xxgc.wujiaoservice.entity.UsersEntity;
import com.xxgc.wujiaoservice.mapper.UserMapper;
import com.xxgc.wujiaoservice.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;
    @Override
    public UsersEntity userLogin(String openId) {
        UsersEntity usersEntity = userMapper.selectUserByOpenId(openId);
        return usersEntity;
    }

    @Override
    public void addUser(UsersEntity user) {
        int i = userMapper.insert(user);
        if (i == 1){
            System.out.println("添加成功");
        }
    }
}
